/*
 * @(#)DataHandlerException.java $version 2012-3-2
 * 
 * Copyright 2011 RogueDevelopment Gruop. All rights Reserved.
 * ROGUEDEVELOPMENT PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nadostar.extensions.data;

/**
 * @author LEESUNG
 *
 */
@SuppressWarnings("serial")
public class DataHandlerException extends RuntimeException {
	/**
	 * Instantiates a new data handler exception.
	 */
	public DataHandlerException() {
		super();
	}

	/**
	 * Instantiates a new data handler exception.
	 * 
	 * @param message the message
	 */
	public DataHandlerException(String message) {
		super(message);
	}

	/**
	 * Instantiates a new data handler exception.
	 * 
	 * @param message the message
	 * @param cause the cause
	 */
	public DataHandlerException(String message, Throwable cause) {
		super(message, cause.getCause());
		this.setStackTrace(cause.getStackTrace());
	}

	/**
	 * Instantiates a new data handler exception.
	 * 
	 * @param cause the cause
	 */
	public DataHandlerException(Throwable cause) {
		super(cause.getMessage(), cause.getCause());
		this.setStackTrace(cause.getStackTrace());
	}

	/**
	 * @see java.lang.Throwable#getMessage()
	 * {@inheritDoc}
	 */
	@Override
	public String getMessage() {
		String msg = super.getMessage();

		if (msg == null) {
			return "Unexpected exception.";
		} else {
			return msg;
		}
	}
}
